package com.campus.service.impl;

import com.campus.dao.CourseDao;
import com.campus.model.Course;
import com.campus.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    private CourseDao courseDao;

    @Override
    public Course createCourse(Course course) throws Exception {
        int ret=courseDao.createCourse(course);
        if(ret!=1){
            throw new Exception("fail to create");
        }
        else{
            return course;
        }
    }
}
